<template>
  <div>
    <van-nav-bar
      title="新消息通知"
      left-text="返回"
      left-arrow
      @click-left="onClickLeft"
    />
    <van-cell title="收到新消息通知" :value="isOpen" size="large" />
    <van-cell center title="标题">
      <template #right-icon>
        <van-switch v-model="checked" size="24" @click="switchHandle" />
      </template>
    </van-cell>
  </div>
</template>

<script>
export default {
  name: "NewInfo",
  data() {
    return {
      isOpen: "已开启",
      checked: true,
    };
  },
  methods: {
    onClickLeft() {
      this.$router.back(); //返回按钮
    },
    switchHandle() {
        if(this.checked){
            this.isOpen='已关闭'
        }else{
           this.isOpen= "已开启"
        }
    },
  },
};
</script>

<style>
</style>